package com.lanou.dormitory.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lanou.dormitory.dao.AdminMapper;
import com.lanou.dormitory.entity.Admin;

@Service
public class AdminServiceImpl implements AdminServic{

	@Autowired
	private AdminMapper adminMapper;
	
	@Override
	public Admin login(String username, String password) {
		
		return adminMapper.login(username, password);
	}
    @Override
	public void update(Admin admin) {
		adminMapper.update(admin);
	}
    @Override
    public void updatePwd(Integer adminid,String newpwd) {
    	adminMapper.updatePwd(adminid, newpwd);
    }
	@Override
	public List<Admin> getAll() {
		// TODO Auto-generated method stub
		return adminMapper.getAll();
	}
	@Override
	public Admin getQueryByUserName(String username) {
		return adminMapper.getQueryByUserName(username);
	}
	@Override
	public void addAdmin(Admin admin) {
		adminMapper.addAdmin(admin);
		
	}
	@Override
	public Admin getAdminById(Integer adminid) {
		
		return adminMapper.getAdminById(adminid);
	}

	@Override
	public void update2(Admin admin) {
		adminMapper.update2(admin);
		
	}
	@Override
	public void deleteById(Integer adminid) {
		adminMapper.deleteById(adminid);
		
	}

}
